t=0:0.01:40;
w_L=4;
w_R=8;
s_L=cos(w_L*t);
s_R=cos(w_R*t);
s_mono=s_L+s_R;
s_diff=s_L-s_R;
figure(1)
subplot(2,2,1)
plot(t,s_L)
title('Left channel')
subplot(2,2,2)
plot(t,s_R)
title('Right channel')
subplot(2,2,3)
plot(t,s_mono)
title('S_{MONO}')
subplot(2,2,4)
plot(t,s_diff)
title('S_{DIFF}')

w0=30;
A0=2;
k=1;
myplot(t,s_mono+(A0*k+s_diff).*cos(w0*t),s_mono+A0*k+s_diff,s_mono-A0*k-s_diff,k,2)
k=0.2;
myplot(t,s_mono+(A0*k+s_diff).*cos(w0*t),s_mono+A0*k+s_diff,s_mono-A0*k-s_diff,k,4)
k=0;
myplot(t,s_mono+(A0*k+s_diff).*cos(w0*t),s_mono+A0*k+s_diff,s_mono-A0*k-s_diff,k,6)

